package cn.vendpay.com.controller;


import cn.vendcommon.com.entity.DeductionRecord;
import cn.vendcommon.com.entity.Result;
import cn.vendcommon.com.entity.dto.PhoneRequestDTO;
import cn.vendpay.com.service.DeductionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/deductionRecord")
public class DeductionRecordController {

    @Autowired
    private DeductionRecordService deductionRecordService;


    @PostMapping("/list")
    public Result<List<DeductionRecord>> getDeductionRecordListByUserId(@RequestBody PhoneRequestDTO phoneRequestDTO) {
        System.out.println(deductionRecordService.getDeductionRecordListByPhone(phoneRequestDTO.getPhone()));
        return Result.success(deductionRecordService.getDeductionRecordListByPhone(phoneRequestDTO.getPhone()));
    }
}
